package group.program.Service.impl;

import group.program.Config.DatabaseConfig;
import group.program.Service.DatabaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DatabaseServiceImpl implements DatabaseService {
    @Autowired
    private DatabaseConfig databaseConfig;
    @Override
    public void addDatabase(String name, String url, String username, String password) {
        databaseConfig.addName(name);
        databaseConfig.addUrl(url);
        databaseConfig.addUsername(username);
        databaseConfig.addPassword(password);
    }

    @Override
    public void removeDatabase(String name, String url, String username, String password) {
        databaseConfig.removeName(name);
        databaseConfig.removeUrl(url);
        databaseConfig.removeUsername(username);
        databaseConfig.removePassword(password);
    }
}
